#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    long long findTheArrayConcVal(vector<int> &nums)
    {
        int begin = 0, end = nums.size() - 1;
        long long ret = 0;
        while (begin < end)
        {
            auto tmp = to_string(nums[begin]) + to_string(nums[end]);
            ret += atoi(tmp.c_str());
            begin += 1;
            end -= 1;
        }
        if (begin == end)
        {
            ret += nums[begin];
        }
        return ret;
    }
};